package com.chanyachting.emall.util;

public class Pager {

	
	private int rowSize;  //记录总数
	
	private int pageRowsSize=10;  //每页显示记录数 默认10
	 
	private int pageNumber; //总页数
	
	
	public Pager(){
		
		
	}
	
	public Pager(int pageRowsSize){
		
		this.pageRowsSize=pageRowsSize;
	}
	

	public int getRowSize() {
		return rowSize;
	}

	public void setRowSize(int rowSize) {
		this.rowSize = rowSize;
	}

	public int getPageRowsSize() {
		return pageRowsSize;
	}

	public void setPageRowsSize(int pageRowsSize) {
		this.pageRowsSize = pageRowsSize;
	}

	public int getPageNumber() {
		
		if(this.getRowSize()==0 || this.getPageRowsSize()==0) return 0;
		
		this.pageNumber = this.getRowSize()/this.getPageRowsSize()+(this.getRowSize()%this.getPageRowsSize()==0?0:1);//总页数
		
		return pageNumber;
	}

	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}
	
	

}
